﻿<?xml version="1.0" encoding="utf-8" ?>

<cls:class
	name="Mouse"
	type="http://metalx.org/Input/Mouse"
	static="true"
	xmlns="http://metalx.org/Program"
	xmlns:mm="http://metalx.org/i386/Functions/MemoryManager"
	xmlns:dbg="http://metalx.org/i386/Functions/Debug"
	xmlns:bool="http://metalx.org/i386/Functions/Boolean"
	xmlns:byte="http://metalx.org/i386/Functions/Byte"
	xmlns:short="http://metalx.org/i386/Functions/Short"
	xmlns:int="http://metalx.org/i386/Functions/Integer"
	xmlns:hex="http://metalx.org/i386/Functions/Hexadecimal"
	xmlns:float="http://metalx.org/i386/Functions/Float"
	xmlns:dbl="http://metalx.org/i386/Functions/Double"
	xmlns:real="http://metalx.org/i386/Functions/Real"
	xmlns:lst="http://metalx.org/i386/Functions/List"
	xmlns:loop="http://metalx.org/i386/Functions/Loop"
	xmlns:con="http://metalx.org/i386/Functions/Console"
	xmlns:str="http://metalx.org/i386/Functions/String"
	xmlns:clsf="http://metalx.org/i386/Functions/Class"
	xmlns:var="http://metalx.org/Variable"
	xmlns:sys="http://metalx.org/i386/Functions/System"
	xmlns:cat="http://metalx.org/i386/Functions/Catalog"
	xmlns:obj="http://metalx.org/i386/Functions/Object"
	xmlns:mouse="http://metalx.org/i386/Functions/Mouse"
	xmlns:asc="http://metalx.org/Ansi/Ascii"
	xmlns:fpu="http://metalx.org/Intel/80386/FpuOperators"
	xmlns:logic="http://metalx.org/Intel/80386/Logic"
	xmlns:math="http://metalx.org/Intel/80386/Math"
	xmlns:ari="http://metalx.org/Intel/80386/Arithmetic"
	xmlns:shift="http://metalx.org/Intel/80386/Shift"
	xmlns:imm="http://metalx.org/Intel/80386/Immediate"
	xmlns:inc="http://metalx.org/Intel/80386/Increment"
	xmlns:index="http://metalx.org/Intel/80386/Index"
	xmlns:cpu="http://metalx.org/Intel/80386/Operators"
	xmlns:op="http://metalx.org/Intel/80386/Operands"
	xmlns:cls="http://metalx.org/Class">

	<cls:method name="Enable" type="http://metalx.org/Object" static="true">
		<mouse:Enable/>

		<cpu:CopyImmediateToDI/>
		<int>0</int>
		
		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="Disable" type="http://metalx.org/Object" static="true">
		<mouse:Disable/>

		<cpu:CopyImmediateToDI/>
		<int>0</int>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetReader" type="http://metalx.org/Input/Mouse/MouseReader" static="true">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetData/>

		<mm:CheckOut length="4"/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddress/>

		<cpu:CopyRegisterToOperand/>
		<op:AX-DIAddress/>

		<obj:Create length="4" type="http://metalx.org/Input/Mouse/MouseReader"/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetEventReader" type="http://metalx.org/Input/Mouse/MouseEventReader" static="true">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetData/>

		<mm:CheckOut length="4"/>

		<cpu:CopyOperandToRegister/>
		<op:AX-SIAddress/>

		<cpu:CopyRegisterToOperand/>
		<op:AX-DIAddress/>

		<obj:Create length="4" type="http://metalx.org/Input/Mouse/MouseEventReader"/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="ToString" type="http://metalx.org/String">
		<cpu:CopyImmediateToDI/>
		<addressOf ref="className" type="Absolute32"/>

		<str:CreateObject/>

		<cpu:ReturnToNearCaller/>

		<var:string id="className">PS/2 Mouse</var:string>
	</cls:method>

	<cls:method name="GetClass" type="http://metalx.org/Class">
		<cpu:CopyRegisterToOperand/>
		<op:DI-SIRegister/>

		<obj:GetType/>

		<cpu:CopyRegisterToOperand/>
		<op:SI-DIRegister/>

		<clsf:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>

	<cls:method name="GetClass" type="http://metalx.org/Class" static="true">
		<cpu:CopyRegisterToOperand/>
		<op:BX-DIRegister/>

		<clsf:CreateObject/>

		<cpu:ReturnToNearCaller/>
	</cls:method>
</cls:class>